/*
 * Copyright 2013 NJUT  qixiaobo. All rights reserved.
 */
package com.fujitsu.nanjing.tieba.base.resolver;

import java.io.ByteArrayInputStream;
import java.io.IOException;

import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;

/**
 * IgnoreDTDEntityResolver.java
 * 
 * @author Administrator
 */
public class IgnoreDTDEntityResolver implements EntityResolver {
	@Override
	public InputSource resolveEntity(String publicId, String systemId)
			throws SAXException, IOException {
		if (systemId.equals("http://www.eclipse.org/aspectj/dtd/aspectj.dtd"))
			return new InputSource(new ByteArrayInputStream(
					"<?xml version=’1.0′ encoding=’UTF-8′?>".getBytes()));
		else
			return null;
	}
}
